package memorphic.samplr.views
{
	import flash.events.Event;
	
	import memorphic.samplr.ISamplrAppProps;
	import memorphic.slide.IStateView;
	import memorphic.slide.SlidePresModelBase;
	
	import mx.collections.ArrayCollection;

	public class GalleryViewPresModel extends SlidePresModelBase
	{
		[Bindable]
		public var appProps:ISamplrAppProps;
		
		private var __currentPhotoList:ArrayCollection
		
		public function GalleryViewPresModel(view:IStateView)
		{
			super(view);
			appProps = view as ISamplrAppProps;
		}
		
		protected override function initView():void
		{
			appProps = view as ISamplrAppProps;
		}
		
		[Trigger(path="appProps.currentGallery.photoList")]
		[Bindable(event="currentPhotoListChanged")]
		public function get currentPhotoList():ArrayCollection
		{
			return __currentPhotoList;
		}
		
		public function set currentPhotoList(v:ArrayCollection):void
		{
			__currentPhotoList = v;
			dispatchEvent(new Event("currentPhotoListChanged"));
		}
	}
}